﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using CoreEx.Database.Metadata;

namespace CoreEx.Database.Linq
{
    /// <summary>
    /// Represents a class that returns a list of <see cref="LoadOption"/> instances based 
    /// <see cref="ITable{T}"/> references contained in the target <see cref="Expression"/>.
    /// </summary>
    public interface ILoadOptionFactory
    {
        /// <summary>
        /// Creates a list of <see cref="LoadOption"/> instances indexed by their target type.
        /// </summary>
        /// <param name="expression">The target <see cref="Expression"/></param>
        /// <returns>A list of <see cref="LoadOption"/> instances indexed by their target type.</returns>
        IDictionary<Type, IList<LoadOption>> CreateLoadOptions(Expression expression, ITypeInfoMapper typeInfoMapper);
    }
}
